package com.atguigu.jxc.dao;

import com.atguigu.jxc.entity.Goods;
import com.atguigu.jxc.entity.Unit;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @description 商品信息
 */
@Mapper
public interface GoodsDao {

    String getMaxCode();

    List<Unit> getAllUnits();

    List<Goods> queryAllGoodsByCondition(@Param("goodsName") String goodsName, @Param("goodsTypeIds") List<Integer> goodsTypeIds);

    void saveGoods(@Param("goods") Goods goods);

    void updateGoodsById(@Param("goods") Goods goods);

    void deleteGoodsById(@Param("goodsId") Integer goodsId);

    List<Goods> getNoStockGoodsByCondition(@Param("nameOrCode") String nameOrCode);

    List<Goods> getHasStockGoodsByPageAndCondition(@Param("nameOrCode") String nameOrCode);

    void setInventoryQuantityAndPurchasingPrice(@Param("goodsId") Integer goodsId, @Param("inventoryQuantity") Integer inventoryQuantity, @Param("purchasingPrice") double purchasingPrice);

    void deleteStockById(@Param("goodsId") Integer goodsId);

    List<Goods> getIndexGoodsByPageAndCondition(@Param("codeOrName") String codeOrName, @Param("goodsTypeIds") List<Integer> goodsTypeIds);

    Goods findGoodsById(@Param("goodsId") Integer goodsId);
}
